<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./updateLottery.xhtml">

            <ui:define name="tabContent">
                <h:form>
                    <h:panelGrid columns="2">
                        <h:panelGrid columns="2">
                            Ngày quay 
                            <p:calendar id ="openDate" value="#{lotteryBean.selected.ngayQuay}" timeZone="Asia/Saigon" navigator="true"  pattern="dd/MM/yyyy hh:mm:ss">
                                <p:ajax async="true" event="blur" listener="#{lotteryBean.onChangeDate()}" update="provinces preview"/>
                            </p:calendar>
                            Tỉnh quay  
                            <p:selectOneMenu id="provinces" value="#{lotteryBean.selected.tinhQuay}" style="width: 150px">
                                <f:selectItem itemLabel="Miền Bắc - MB" itemValue="Miền Bắc"/>
                                <f:selectItems value="#{lotteryBean.provinces}"/>
                            </p:selectOneMenu>

                            Thông tin KQXS: 
                            <p:inputTextarea cols="50" rows="10" value="#{lotteryBean.rawLotteryText}">
                            </p:inputTextarea>

                            &nbsp;
                            <p:commandButton ajax="false" value="Cập nhật" action="#{lotteryBean.saveResult()}"/>
                            <!--                                <p:commandButton ajax="false" value="Cập nhật"/>-->
                        </h:panelGrid>

                        <h:outputText id="preview" value="#{lotteryBean.selected.toHtml()}" escape="false"/>
                    </h:panelGrid>
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
